package com.gdou.teaching.mapper;

import com.gdou.teaching.dataobject.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper {


    User selectUserByUserNumber(@Param("userNumber")String userNumber, @Param("status")Integer status);
    //  增
    int addUser(User user);
    //    根据id查
    User selectUserById(@Param("userId")int userId);
    //    根据班级id查
    List<User> selectUserListByClassId(@Param("classId")Integer classId, @Param("status")Integer status);
    //    根据用户状态查
    List<User> selectUserListByUserStatus(Integer userStatus);
    //    根据用户身份查
    List<User> selectUserListByUserIdent(@Param("userIdent")Integer userIdent, @Param("status")Integer status);
//    改
    boolean updateUser(User user);
//    删
    boolean deleteUserByUserId(Integer userId);

    boolean deleteUsersByUserNumber(List<String> userNumbers);
    //批量增加用户
    int addUsers(List<User> users);
    //通过工号批量获取用户
    List<User> selectUserListByUserNumber(List<String> userNumbers,Integer status);

    Integer getCountByClassId(@Param("classId")Integer classId, @Param("status")Integer status);

    List<User> getUserListByIds(List<Integer> userIds);

}
